package com.AAL.Model;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the PurchaseInvoices database table.
 * 
 */
@Entity
@Table(name="PurchaseInvoices")
public class PurchaseInvoice implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PurchaseInvoiceID")
	private String purchaseInvoiceID;

	@Column(name="Discount")
	private int discount;

	@Column(name="IsReceived")
	private boolean isReceived;

	@Column(name="IsWritingWarehousingVotes")
	private boolean isWritingWarehousingVotes;

	@Column(name="PreTotalMoney")
	private BigDecimal preTotalMoney;

	@Column(name="Tax")
	private int tax;

	@Column(name="TotalMoney")
	private BigDecimal totalMoney;

	@Column(name="WritingDate")
	private Timestamp writingDate;

	//bi-directional many-to-one association to LogForStock
	@OneToMany(mappedBy="purchaseInvoice", cascade={CascadeType.REMOVE, CascadeType.REFRESH})
	private List<LogForStock> logForStocks;

	//bi-directional many-to-one association to PurchaseInvoiceDetail
	@OneToMany(mappedBy="purchaseInvoice", cascade={CascadeType.REMOVE, CascadeType.REFRESH})
	private List<PurchaseInvoiceDetail> purchaseInvoiceDetails;

	//bi-directional many-to-one association to Employee
	@ManyToOne(cascade={CascadeType.REFRESH})
	@JoinColumn(name="EmployeeID")
	private Employee employeeByCoordinator;

	//bi-directional many-to-one association to Employee
	@ManyToOne(cascade={CascadeType.REFRESH})
	@JoinColumn(name="Manager")
	private Employee employeeByManager;

	//bi-directional many-to-one association to PurchaseContract
	@ManyToOne(cascade={CascadeType.REFRESH})
	@JoinColumn(name="PurchaseContractID")
	private PurchaseContract purchaseContract;

	//bi-directional many-to-one association to StatusOfInvoice
	@ManyToOne(cascade={CascadeType.REFRESH})
	@JoinColumn(name="StatusOfInvoiceID")
	private StatusOfInvoice statusOfInvoice;

    public PurchaseInvoice() {
    }

	public String getPurchaseInvoiceID() {
		return this.purchaseInvoiceID;
	}

	public void setPurchaseInvoiceID(String purchaseInvoiceID) {
		this.purchaseInvoiceID = purchaseInvoiceID;
	}

	public int getDiscount() {
		return this.discount;
	}

	public void setDiscount(int discount) {
		this.discount = discount;
	}

	public boolean getIsReceived() {
		return this.isReceived;
	}

	public void setIsReceived(boolean isReceived) {
		this.isReceived = isReceived;
	}

	public boolean getIsWritingWarehousingVotes() {
		return this.isWritingWarehousingVotes;
	}

	public void setIsWritingWarehousingVotes(boolean isWritingWarehousingVotes) {
		this.isWritingWarehousingVotes = isWritingWarehousingVotes;
	}

	public BigDecimal getPreTotalMoney() {
		return this.preTotalMoney;
	}

	public void setPreTotalMoney(BigDecimal preTotalMoney) {
		this.preTotalMoney = preTotalMoney;
	}

	public int getTax() {
		return this.tax;
	}

	public void setTax(int tax) {
		this.tax = tax;
	}

	public BigDecimal getTotalMoney() {
		return this.totalMoney;
	}

	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}

	public Timestamp getWritingDate() {
		return this.writingDate;
	}

	public void setWritingDate(Timestamp writingDate) {
		this.writingDate = writingDate;
	}

	public List<LogForStock> getLogForStocks() {
		return this.logForStocks;
	}

	public void setLogForStocks(List<LogForStock> logForStocks) {
		this.logForStocks = logForStocks;
	}
	
	public List<PurchaseInvoiceDetail> getPurchaseInvoiceDetails() {
		return this.purchaseInvoiceDetails;
	}

	public void setPurchaseInvoiceDetails(List<PurchaseInvoiceDetail> purchaseInvoiceDetails) {
		this.purchaseInvoiceDetails = purchaseInvoiceDetails;
	}
	
	public Employee getEmployeeByCoordinator() {
		return this.employeeByCoordinator;
	}

	public void setEmployeeByCoordinator(Employee employeeByCoordinator) {
		this.employeeByCoordinator = employeeByCoordinator;
	}
	
	public Employee getEmployeeByManager() {
		return this.employeeByManager;
	}

	public void setEmployeeByManager(Employee employeeByManager) {
		this.employeeByManager = employeeByManager;
	}
	
	public PurchaseContract getPurchaseContract() {
		return this.purchaseContract;
	}

	public void setPurchaseContract(PurchaseContract purchaseContract) {
		this.purchaseContract = purchaseContract;
	}
	
	public StatusOfInvoice getStatusOfInvoice() {
		return this.statusOfInvoice;
	}

	public void setStatusOfInvoice(StatusOfInvoice statusOfInvoice) {
		this.statusOfInvoice = statusOfInvoice;
	}
	
}